****************************************
*
* Do-file
* Updated. June 2021
*
****************************************

use "insecure_institutions_final.dta",clear 
set more off


eststo clear

***TABLE 2 Descriptive Statistics
sum courtattacke antigovdemonst histofattacks power minpres termyear predattack


***TABLE 3 Estimates: 

* M1
logit courtattacke antigovdemonst histofattacks power minpres termyear predattack, cluster(ccode)
eststo


* M2
logit courtattacke antigovdemonst histofattacks power minpres termyear predattack jlavnew, cluster(ccode)
eststo


* M3
reg antigovdemonst_banks lagged_comm_repec histofattacks power minpres termyear predattack, cluster(ccode)
predict commhat2
drop if antigovdemonst_banks==.
logit courtattacke commhat2 histofattacks power minpres termyear predattack, cluster(ccode)
eststo

*M4
reg antigovdemonst_banks lagged_comm_repec histofattacks power minpres termyear predattack jlavnew, cluster(ccode)
predict commhat3
drop if antigovdemonst_banks==.
logit courtattacke commhat3 histofattacks power minpres termyear predattack jlavnew, cluster(ccode)
eststo

label variable antigov Protest 
label variable histofattacks Past_Presidential_Crises
label variable power Presidential_Power 
label variable minpres Divided_Government
label variable termyear Term
label variable predattack Previous_Manipulation
label variable jlavnew Judicial_Trust_lagged


esttab, se label star(* .1 ** .05 *** .01) scalar(chi2)

esttab using result_latex.tex,  se label star(* .1 ** .05 *** .01) scalar(chi2)

esttab using result_latex.doc,  se label star(* .1 ** .05 *** .01) scalar(chi2)





